﻿<?xml version="1.0" encoding="utf-8" ?>
<!--Created with Liquid XML Studio Developer Edition (Trial) 9.0.11.3078 (http://www.liquid-technologies.com)-->
<xs:schema
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns="urn:be:cin:mycarenet:esb:common:v2"
	xsi:schemaLocation="http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema.xsd"
	elementFormDefault="qualified"
	targetNamespace="urn:be:cin:mycarenet:esb:common:v2"
	xmlns:xs="http://www.w3.org/2001/XMLSchema">
	<xs:annotation>
		<xs:documentation>Version 2.0: Initial version
			Version 2.1: Added SiteID
		</xs:documentation>
	</xs:annotation>
  <!--xs:include schemaLocation="commonInfo-v2-Ref.xsd" /-->
    <xs:include schemaLocation="commonInfo-v2-Basic.xsd"/>
	<xs:element
		name="CommonInput"
		type="CommonInputType" />
	<xs:complexType name="CommonInputType">
		<xs:annotation>
			<xs:documentation>
				The "root"-type of the common input element.
			</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element
				name="Request"
				type="RequestType">
				<xs:annotation>
					<xs:documentation>
						Generic information about the request itself.
					</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element
				name="Origin"
				type="OrigineType">
				<xs:annotation>
					<xs:documentation>
						Common input about the origin of the request.
					</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element
				name="InputReference"
				type="StringReferenceType"
				minOccurs="0" />
			<xs:element
				name="NIPReference"
				type="StringReferenceType"
				minOccurs="0" />
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="RecordCommonInputType">
		<xs:sequence>
			<xs:element
				name="InputReference"
				type="Num14ReferenceType"
				minOccurs="0" />
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="CommonOutputType">
		<xs:annotation>
			<xs:documentation>
				The "root"-type of the common output element.
			</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element
				name="InputReference"
				type="StringReferenceType"
				minOccurs="0" />
			<xs:element
				name="NIPReference"
				type="StringReferenceType"
				minOccurs="0" />
			<xs:element
				name="OutputReference"
				type="StringReferenceType"
				minOccurs="0" />
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="RecordCommonOutputType">
		<xs:sequence>
			<xs:element
				name="InputReference"
				type="Num14ReferenceType"
				minOccurs="0" />
			<xs:element
				name="OutputReference"
				type="Num14ReferenceType"
				minOccurs="0" />
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="RequestType">
		<xs:annotation>
			<xs:documentation>
				Information about the request.
			</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element
				name="IsTest"
				type="xs:boolean">
				<xs:annotation>
					<xs:documentation>
						Indicates if the message is a test message or not.
					</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="OrigineType">
		<xs:annotation>
			<xs:documentation>
				Information about the originator of the request.
			</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element
				name="Package"
				type="PackageType">
				<xs:annotation>
					<xs:documentation>
						The package that the originator used to send the
						request.
					</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element
				name="SiteID"
				type="ValueRefString"
				maxOccurs="1"
				minOccurs="0" />
			<xs:element
				name="CareProvider"
				type="CareProviderType"
				minOccurs="0">
				<xs:annotation>
					<xs:documentation>
						The care provider for which the request was
						sent. This is not necessary the party that sent
						the request, but it can be.
					</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="PackageType">
		<xs:annotation>
			<xs:documentation>
				Information about the software package that is connected
				to MyCareNet.
			</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="AbstractIdType">
				<xs:sequence>
					<xs:element
						name="License"
						type="LicenseType">
						<xs:annotation>
							<xs:documentation>
								Each software package provider receives a license when
								he is granted access to MyCareNet. The
								package must
								provide this license in this element.
							</xs:documentation>
						</xs:annotation>
					</xs:element>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:complexType name="LicenseType">
		<xs:annotation>
			<xs:documentation>
				Information about the license of a package.
			</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element
				name="Username"
				type="xs:string">
				<xs:annotation>
					<xs:documentation>
						The user name of the license.
						This is a unique identifier of the package.
					</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element
				name="Password"
				type="xs:string">
				<xs:annotation>
					<xs:documentation>
						The password of the license.
						This is required to prove the identify of the package.
					</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="PartyType">
		<xs:annotation>
			<xs:documentation>
				Information about the party.
				A party is rather general. some examples are
				<ol xmlns="http://www.w3.org/1999/xhtml">
					<li>A physical person by itself</li>
					<li>A physical person working for an enterprise</li>
					<li>A enterprise by itself</li>
				</ol>
			</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element
				name="PhysicalPerson"
				type="IdType"
				minOccurs="0">
				<xs:annotation>
					<xs:documentation>
						<p xmlns="http://www.w3.org/1999/xhtml">
							The physical person that authenticated to send the request.
							This can only be omitted when the
							organization was
							authenticated by a eHealth certificate.
						</p>
						<p xmlns="http://www.w3.org/1999/xhtml">
							The SAML-ticket should contain the same information, although
							there are exception possible in case there
							is an organization.
							When not present in the SAML-ticket this information is treated
							as information. This data in
							this element should correspond
							to one or multiple of the following attributes:
						</p>
						<ol xmlns="http://www.w3.org/1999/xhtml">
							<li>urn:be:fgov:person:ssin</li>
							<li>urn:be:fgov:ehealth:1.0:certificateholder:person:ssin</li>
						</ol>
					</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element
				name="Organization"
				type="IdType"
				minOccurs="0">
				<xs:annotation>
					<xs:documentation>
						<p xmlns="http://www.w3.org/1999/xhtml">
							The organization (enterprise, laboratory, hospital, ...)
							that was authenticated to send the request. This can only
							be omitted when the sender isn't part of an organization that
							is relevant for the request.
							<br />
							Organization that have no link with the requests should not
							be provided. For example, 'physical person A' should
							not specify
							his employer 'enterprise B' if he got a personal mandate from
							nurse C (his wife).
						</p>
						<p xmlns="http://www.w3.org/1999/xhtml">
							The same information must be present in the SAML-ticket. It
							can be in one or multiple of the following
							attributes:
						</p>
						<ol xmlns="http://www.w3.org/1999/xhtml">
							<li>urn:be:fgov:ehealth:1.0:xxx:yyy-number</li>
							<li>urn:be:fgov:ehealth:1.0:certificateholder:xxx:yyy-number</li>
						</ol>
					</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="CareProviderType">
		<xs:annotation>
			<xs:documentation>
				Information about a care provider. This is a person or
				institution that provides health care service
				to persons.
			</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element
				name="Nihii"
				type="NihiiType">
				<xs:annotation>
					<xs:documentation>
						The NIHII (FR:INAMI, NL:RIZIV) number of the care provider.
						This is always required.
					</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element
				name="PhysicalPerson"
				type="IdType"
				minOccurs="0">
				<xs:annotation>
					<xs:documentation>
						The physical person that is linked to the NIHII number provided.
						Should only be provided when the
						NIHII is linked a person. See
						service catalogue for more details.
					</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element
				name="Organization"
				type="IdType"
				minOccurs="0">
				<xs:annotation>
					<xs:documentation>
						The organization that is linked to the NIHII number provided.
						Should only be provided when the
						NIHII is linked an organization.
						See service catalogue for more details.
					</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType
		name="AbstractIdType"
		abstract="true">
		<xs:annotation>
			<xs:documentation>
				Everything that is an entity derives from this type. Enties
				are object that are distinguishable and
				have a name. This name
				isn't nesesary unique.
			</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="SelfRefType">
				<xs:sequence>
					<xs:element
						name="Name"
						type="ValueRefString"
						minOccurs="0">
						<xs:annotation>
							<xs:documentation>
								Optional name of entity. If provided it is used in a pure
								informal way. It will be added to
								certain logs and might
								appear on some representations.
							</xs:documentation>
						</xs:annotation>
					</xs:element>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:complexType name="IdType">
		<xs:annotation>
			<xs:documentation>
				Enities that have a unique identification have this type. This
				identification is always issued by an authority. Only
				one of
				the child elements is required, the others are prohibited.
				<br xmlns="http://www.w3.org/1999/xhtml" />
				In other words, this is actualy a xsd-choise, but this does
				not always translate so well in code. Therefore we
				decided to
				make it an sequence with all optional elements.
			</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="AbstractIdType">
				<xs:sequence>
					<xs:element
						name="Nihii"
						type="NihiiType"
						minOccurs="0">
						<xs:annotation>
							<xs:documentation>
								Identification issued by the NIHII. It uniquely specifies a
								care provider in his role.
							</xs:documentation>
						</xs:annotation>
					</xs:element>
					<xs:element
						name="Ssin"
						type="ValueRefString"
						minOccurs="0">
						<xs:annotation>
							<xs:documentation>
								Identification issued by the National Registry of Belgium.
								It uniquely specifies a physical
								person.
							</xs:documentation>
						</xs:annotation>
					</xs:element>
					<xs:element
						name="Cbe"
						type="ValueRefString"
						minOccurs="0">
						<xs:annotation>
							<xs:documentation>
								Identification issued by the CBE. It uniquely specifies an
								enterprise.
							</xs:documentation>
						</xs:annotation>
					</xs:element>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:complexType name="NihiiType">
		<xs:annotation>
			<xs:documentation>
				The NIHII number with its meta-data.
			</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="SelfRefType">
				<xs:sequence>
					<xs:element
						name="Quality"
						type="xs:string"
						minOccurs="0">
						<xs:annotation>
							<xs:documentation>
								Meta-data that indicates to which type of care provider
								the NIHII number was assigned too. This
								element is required
								and can only be obmitted when the parent element references
								another element.
							</xs:documentation>
						</xs:annotation>
					</xs:element>
					<xs:element
						name="Value"
						type="ValueRefString"
						minOccurs="0">
						<xs:annotation>
							<xs:documentation>
								The NIHII number itself. This element is required
								and can only be obmitted when the parent
								element references
								another element.
							</xs:documentation>
						</xs:annotation>
					</xs:element>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:simpleType name="MessageReferenceType">
		<xs:restriction base="xs:string">
			<xs:length value="14" />
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="Num14ReferenceType">
		<xs:restriction base="xs:decimal">
			<xs:minInclusive value="0" />
			<xs:maxInclusive value="99999999999999" />
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="StringReferenceType">
		<xs:restriction base="xs:string">
			<xs:maxLength value="14" />
		</xs:restriction>
	</xs:simpleType>
</xs:schema>
